3.23 \(\int (a+b \sec ^2(e+f x))^2 \sin ^2(e+f x) \, dx\)

Optimal. Leaf size=73 \[ \frac {a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac {a (a-4 b) \tan (e+f x)}{2 f}+\frac {1}{2} a x (a-4 b)+\frac {b^2 \tan ^3(e+f x)}{3 f} \]

[Out]

1/2*a*(a-4*b)*x-1/2*a*(a-4*b)*tan(f*x+e)/f+1/2*a^2*sin(f*x+e)^2*tan(f*x+e)/f+1/3*b^2*tan(f*x+e)^3/f

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {4132, 463, 459, 321, 203} \[ \frac {a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac {a (a-4 b) \tan (e+f x)}{2 f}+\frac {1}{2} a x (a-4 b)+\frac {b^2 \tan ^3(e+f x)}{3 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[e + f*x]^2)^2*Sin[e + f*x]^2,x]

[Out]

(a*(a - 4*b)*x)/2 - (a*(a - 4*b)*Tan[e + f*x])/(2*f) + (a^2*Sin[e + f*x]^2*Tan[e + f*x])/(2*f) + (b^2*Tan[e +
f*x]^3)/(3*f)

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 459

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*(e*x)^(m
+ 1)*(a + b*x^n)^(p + 1))/(b*e*(m + n*(p + 1) + 1)), x] - Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(b*(m +
 n*(p + 1) + 1)), Int[(e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && NeQ[b*c - a*d, 0]
 && NeQ[m + n*(p + 1) + 1, 0]

Rule 463

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^2, x_Symbol] :> -Simp[((b*c - a*
d)^2*(e*x)^(m + 1)*(a + b*x^n)^(p + 1))/(a*b^2*e*n*(p + 1)), x] + Dist[1/(a*b^2*n*(p + 1)), Int[(e*x)^m*(a + b
*x^n)^(p + 1)*Simp[(b*c - a*d)^2*(m + 1) + b^2*c^2*n*(p + 1) + a*b*d^2*n*(p + 1)*x^n, x], x], x] /; FreeQ[{a,
b, c, d, e, m, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[p, -1]

Rule 4132

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_)]^(m_), x_Symbol] :> With[{ff = Fr
eeFactors[Tan[e + f*x], x]}, Dist[ff^(m + 1)/f, Subst[Int[(x^m*ExpandToSum[a + b*(1 + ff^2*x^2)^(n/2), x]^p)/(
1 + ff^2*x^2)^(m/2 + 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[m/2] && Integer
Q[n/2]

Rubi steps

\begin {align*} \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^2(e+f x) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^2 \left (a+b+b x^2\right )^2}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac {\operatorname {Subst}\left (\int \frac {x^2 \left (3 a^2-2 (a+b)^2-2 b^2 x^2\right )}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac {a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac {b^2 \tan ^3(e+f x)}{3 f}-\frac {(a (a-4 b)) \operatorname {Subst}\left (\int \frac {x^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=-\frac {a (a-4 b) \tan (e+f x)}{2 f}+\frac {a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac {b^2 \tan ^3(e+f x)}{3 f}+\frac {(a (a-4 b)) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac {1}{2} a (a-4 b) x-\frac {a (a-4 b) \tan (e+f x)}{2 f}+\frac {a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac {b^2 \tan ^3(e+f x)}{3 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 1.00, size = 126, normalized size = 1.73 \[ -\frac {\sec ^3(e+f x) \left (a \cos ^2(e+f x)+b\right )^2 \left (3 a \cos ^3(e+f x) (a \sin (2 (e+f x))-2 f x (a-4 b))-4 b (6 a-b) \sec (e) \sin (f x) \cos ^2(e+f x)-4 b^2 \tan (e) \cos (e+f x)-4 b^2 \sec (e) \sin (f x)\right )}{3 f (a \cos (2 (e+f x))+a+2 b)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[e + f*x]^2)^2*Sin[e + f*x]^2,x]

[Out]

-1/3*((b + a*Cos[e + f*x]^2)^2*Sec[e + f*x]^3*(-4*b^2*Sec[e]*Sin[f*x] - 4*(6*a - b)*b*Cos[e + f*x]^2*Sec[e]*Si
n[f*x] + 3*a*Cos[e + f*x]^3*(-2*(a - 4*b)*f*x + a*Sin[2*(e + f*x)]) - 4*b^2*Cos[e + f*x]*Tan[e]))/(f*(a + 2*b
+ a*Cos[2*(e + f*x)])^2)

________________________________________________________________________________________

fricas [A]  time = 0.58, size = 81, normalized size = 1.11 \[ \frac {3 \, {\left (a^{2} - 4 \, a b\right )} f x \cos \left (f x + e\right )^{3} - {\left (3 \, a^{2} \cos \left (f x + e\right )^{4} - 2 \, {\left (6 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, b^{2}\right )} \sin \left (f x + e\right )}{6 \, f \cos \left (f x + e\right )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*sin(f*x+e)^2,x, algorithm="fricas")

[Out]

1/6*(3*(a^2 - 4*a*b)*f*x*cos(f*x + e)^3 - (3*a^2*cos(f*x + e)^4 - 2*(6*a*b - b^2)*cos(f*x + e)^2 - 2*b^2)*sin(
f*x + e))/(f*cos(f*x + e)^3)

________________________________________________________________________________________

giac [A]  time = 1.37, size = 72, normalized size = 0.99 \[ \frac {2 \, b^{2} \tan \left (f x + e\right )^{3} + 12 \, a b \tan \left (f x + e\right ) + 3 \, {\left (a^{2} - 4 \, a b\right )} {\left (f x + e\right )} - \frac {3 \, a^{2} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{6 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*sin(f*x+e)^2,x, algorithm="giac")

[Out]

1/6*(2*b^2*tan(f*x + e)^3 + 12*a*b*tan(f*x + e) + 3*(a^2 - 4*a*b)*(f*x + e) - 3*a^2*tan(f*x + e)/(tan(f*x + e)
^2 + 1))/f

________________________________________________________________________________________

maple [A]  time = 0.52, size = 71, normalized size = 0.97 \[ \frac {a^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+2 a b \left (\tan \left (f x +e \right )-f x -e \right )+\frac {b^{2} \left (\sin ^{3}\left (f x +e \right )\right )}{3 \cos \left (f x +e \right )^{3}}}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(f*x+e)^2)^2*sin(f*x+e)^2,x)

[Out]

1/f*(a^2*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)+2*a*b*(tan(f*x+e)-f*x-e)+1/3*b^2*sin(f*x+e)^3/cos(f*x+e)^3
)

________________________________________________________________________________________

maxima [A]  time = 0.44, size = 67, normalized size = 0.92 \[ \frac {2 \, b^{2} \tan \left (f x + e\right )^{3} + 12 \, a b \tan \left (f x + e\right ) + 3 \, {\left (a^{2} - 4 \, a b\right )} {\left (f x + e\right )} - \frac {3 \, a^{2} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{6 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*sin(f*x+e)^2,x, algorithm="maxima")

[Out]

1/6*(2*b^2*tan(f*x + e)^3 + 12*a*b*tan(f*x + e) + 3*(a^2 - 4*a*b)*(f*x + e) - 3*a^2*tan(f*x + e)/(tan(f*x + e)
^2 + 1))/f

________________________________________________________________________________________

mupad [B]  time = 4.46, size = 94, normalized size = 1.29 \[ \frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f}-\frac {a^2\,\sin \left (2\,e+2\,f\,x\right )}{4\,f}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,b^2-2\,b\,\left (a+b\right )\right )}{f}-\frac {a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (e+f\,x\right )\,\left (a-4\,b\right )}{2\,\left (2\,a\,b-\frac {a^2}{2}\right )}\right )\,\left (a-4\,b\right )}{2\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(e + f*x)^2*(a + b/cos(e + f*x)^2)^2,x)

[Out]

(b^2*tan(e + f*x)^3)/(3*f) - (a^2*sin(2*e + 2*f*x))/(4*f) - (tan(e + f*x)*(2*b^2 - 2*b*(a + b)))/f - (a*atan((
a*tan(e + f*x)*(a - 4*b))/(2*(2*a*b - a^2/2)))*(a - 4*b))/(2*f)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2} \sin ^{2}{\left (e + f x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)**2)**2*sin(f*x+e)**2,x)

[Out]

Integral((a + b*sec(e + f*x)**2)**2*sin(e + f*x)**2, x)

________________________________________________________________________________________